<template>
  <div id="setter" class="setter">
    <yd-navbar slot="navbar" fixed>
      <a @click="$router.go(-1)" slot="left">
        <yd-navbar-back-icon></yd-navbar-back-icon>
      </a>
      <span slot="center" style="font-size:18px">设置</span>
    </yd-navbar>

    <div class="content-setter" fixed>
      <div class="space-10"></div>
        <yd-cell-group>
          <yd-cell-item>
            <span slot="left">重置密码：</span>
            <router-link to="/user/repassword" slot="right">
              <yd-navbar-next-icon></yd-navbar-next-icon>
            </router-link>
          </yd-cell-item>
          <yd-cell-item>
            <span slot="left">修改绑定：</span>
            <a @click.native="exit" slot="right">
                <yd-navbar-next-icon></yd-navbar-next-icon>
            </a>
          </yd-cell-item>
        </yd-cell-group>
        <yd-cell-group>
          <yd-cell-item>
            <span slot="left">修改绑定：</span>
            <a @click.native="exit" slot="right">
                <yd-navbar-next-icon></yd-navbar-next-icon>
            </a>
          </yd-cell-item>
        </yd-cell-group>
 
          <div class="space-10"></div>
          <yd-button size="large" bgcolor="#2196f3" color="#fff" @click.native="exit">退出登录</yd-button>
    </div>

  </div>
</template>

<script>
  import axios from '../../axios'
  import baseService from '../../axios/'

  export default {
    name: 'setter',
    data() {
      return {
        msg: ''
      }
    },
    methods: {
      exit: function () {
        baseService.post('/user/logout.do').then((res) => {
          if(res.data.status == 0){
            this.$store.store.state.userInfo = {}
            this.$router.push({path:'/'})
            this.$dialog.alert({
              mes: res.data.data
            });
          }
        })
      }
    }
  }

</script>

<style>
  .setter .content-setter {
    position: fixed;
    padding-top: 13%;
    height: 93%;
    width: 100%;
    overflow-y: auto !important;
  }

</style>
